<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    {{ msg }}
    <br />
    {{ msg | toUpper}}
    <br />
    {{ sex }}
    <br />
    {{ sex | sexFilter }}
    <br />

    {{ lesson | lessonFilter }}
  </div>
</body>
<script src="lib/vue.js"></script>
<script>
  Vue.filter('toUpper', function (value) {
    return value.toUpperCase()
  })
  new Vue({
    el: '#app',
    data: {
      msg: 'hello vue',
      sex: 1,
      lesson: 3
    },
    filters: {
      sexFilter (value) {
        return value === 1 ? '男' : '女'
      },
      lessonFilter (value) {
        return value === 1 ? '一阶段' : value === 2 ? '二阶段' : '三阶段'
      }
    }
  })
</script>
</html>